#include <iostream>
#include <vector>

using namespace std;

// https://leetcode.cn/problems/combination-sum-iii/description/?envType=problem-list-v2&envId=z8Em6vKo
// 216. 组合总和 III

class Solution {
public:
    void recursionTry(vector<vector<int>> &ans, vector<int> &curSet, int begin, int n, int k){
        if(k == 0){
            if(n == 0){
                ans.push_back(curSet);
                return;
            }
            return;
        }
        for (int i = begin; i <= 9; i++){
            if(n < i){
                continue;
            }
            curSet.push_back(i);
            recursionTry(ans, curSet, i + 1, n - i, k - 1);
            curSet.pop_back();
        }
    }
        vector<vector<int>> combinationSum3(int k, int n)
    {
        vector<vector<int>> ans;
        vector<int> curSet;
        recursionTry(ans, curSet, 1, n, k);
        return ans;
    }
};

int main()
{
    return 0;
}
